﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>jQXB simple binding</title>
    <script type="text/javascript" src="../lib/jquery-1.4.4.js"></script>
    <script type="text/javascript" src="../lib/dumpobj.js"></script>
    <script type="text/javascript" src="../lib/jQXB.1.1.js"></script>
</head>
<body>
    <h1>Simple binding</h1>
    <h2>Change data</h2>
    <input type="text" jqxb-datasource="mydata" jqxb-datamember="Name" />
    <input type="text" jqxb-datasource="mydata" jqxb-datamember="Surname" />
    <input type="text" jqxb-datasource="mydata" jqxb-datamember="Address.Street" />
    <input type="text" jqxb-datasource="mydata" jqxb-datamember="Address.ZipCode" />
    <h2>Change data</h2>
    <input type="text" jqxb-datasource="mydata" jqxb-datamember="Name" />
    <input type="text" jqxb-datasource="mydata" jqxb-datamember="Surname" />
    <input type="text" jqxb-datasource="mydata" jqxb-datamember="Address.Street" />
    <input type="text" jqxb-datasource="mydata" jqxb-datamember="Address.ZipCode" />
    <br />

    <input type="button" onclick="jQXB.refreshControls('mydata',null);" value="Force Refresh"/>
    <script type="text/javascript">
        var Customer = { self: this, 'Name': 'Anthony', 'Surname': 'Murray', 'Address': { 'Street': 'Carnaby Street', 'ZipCode': 'YTSCH' }};
        // Common jQuery entry point
        jQuery(document).ready(function () {
            // Initialize the System
            jQXB.initialize();
			// Set datasource with autorefresh set to true
            jQXB.setDataSource('mydata', Customer,true).doBind('mydata');
        });

    </script>
</body>
</html>
